//
//  ViewController.swift
//  fileManagerTest
//
//  Created by BineaJim on 16/4/15.
//  Copyright © 2016年 mloveu. All rights reserved.
//

import UIKit
import MobileCoreServices

class ViewController: UIViewController,UIDocumentPickerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    @IBAction func open(sender: AnyObject) {
        let type = kUTTypeText as String
        let documentPicker = UIDocumentPickerViewController(documentTypes:[type], inMode: .Open)
        documentPicker.delegate = self;
        presentViewController(documentPicker, animated: true, completion: nil);
    }
    
    func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
        print("url(url)");
    }
}

